<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@ page import="banco.*" %>
<%@ page import="java.util.*" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Lista de Clientes</title>
        
        <link rel="stylesheet" type="text/css" href="estilo.css" />
    </head>
    <body>
        <center>
            <h2>Listagem de Clientes</h2>
            
            <div id="lista">
                <table cellspacing="1">
                    <tr>
                        <th align="center">Nome</td>
                        <th align="center">RG</td>
                        <th align="center">CPF</td>
                        <th align="center">Numero</td>
                        <th>                    </td>
                    </tr>
                    <%
                    String nome = new String();
                    String id = new String();
                    int rg;
                    int cpf;
                    int numero;
                    ClienteFacade facade = new ClienteFacade();
                    List listaCliente = facade.listAll();
                    for(int i=0; i < listaCliente.size(); i++){
                    Cliente cliente = (Cliente) listaCliente.get(i);                    
                    %>
                    
                    <tr>
                        <td align="center"><%=cliente.getNome()%></td>
                        <td align="center"><%=cliente.getRg()%></td>
                        <td align="center"><%=cliente.getCpf()%></td>
                        <td align="center"><%=cliente.getNumero()%></td>
                        <td align="center"><a href="./removeCliente.jsp?id=<%=cliente.getId()%>">Remover</a></td>
                    </tr>
                    
                    <%
                    }
                    %>
                </table>
            </div>
            <br> <a href="./index.jsp">Início</a>
        </center>
    </body>
</html>
